//package com.jingxi.Test;
//
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInfo;
//import com.jingxi.common.pojo.EasyUIDataGridResult;
//import com.jingxi.mapper.TbContentMapper;
//import com.jingxi.model.TbContent;
//import com.jingxi.model.TbContentExample;
//import org.junit.Test;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.support.ClassPathXmlApplicationContext;
//
//import java.util.List;
//public class PageHelperTest {
//
//    @SuppressWarnings("resource")
//    @Test
//    public void list() {
//        ApplicationContext applicationContext=new ClassPathXmlApplicationContext
//                ("classpath:spring/applicationContext-*.xml");
//        TbContentMapper tbContentMapper=applicationContext.getBean(TbContentMapper.class);
//       long categoryId=89;
//       int page=1;
//       int rows=10;
//        EasyUIDataGridResult easyUIDataGridResult=new EasyUIDataGridResult();
//        TbContentExample tbContentExample=new TbContentExample();
//        TbContentExample.Criteria criteria=tbContentExample.createCriteria();
//        criteria.andCategoryIdEqualTo(categoryId);
//        PageHelper.startPage(1,10);
//        List<TbContent> li=tbContentMapper.selectByExample(tbContentExample);
//        PageInfo<TbContent> tol=new PageInfo<TbContent>(li);
//        easyUIDataGridResult.setRows(li);
//        easyUIDataGridResult.setTotal(tol.getTotal());
//        System.out.println(easyUIDataGridResult);
//    }
//}
